#ifndef ANSWEREDITVARIANT_H
#define ANSWEREDITVARIANT_H

#include <QtGui/QWidget>
#include <QGridLayout>
#include <QListWidgetItem>
#include "WidgetTextEdit.h"
#include "cdbprovider.h"

namespace Ui {
    class AnswerEditVariant;
}

class AnswerEditVariant : public QWidget {
    Q_OBJECT
    Q_DISABLE_COPY(AnswerEditVariant)
public:
    explicit AnswerEditVariant(QWidget *parent = 0);
    virtual ~AnswerEditVariant();
    QGridLayout * getGrid();
    TextEdit * textEditor;
    void loadAnswerFromDB(int taskId);
    bool wait;
    void setIdTask(int taskId);

protected:
    virtual void changeEvent(QEvent *e);
    int idTask;

private:
    Ui::AnswerEditVariant *m_ui;
    CDBProvider * db;

private slots:
    void on_listWidget_itemChanged(QListWidgetItem* item);
    void on_listWidget_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous);
    void on_rightAnswer_clicked();
    void on_deleteAnswer_clicked();
    void on_addAnswer_clicked();
};

#endif // ANSWEREDITVARIANT_H
